package servidor;

public class GPS
{
	private boolean on;
	private String valor;
	
	public GPS()
	{
		on = false;
		generarCoordenadas();
	}
	
	public GPS(boolean ON, String Valor)
	{
		on = ON;
		valor = Valor;
	}
	
	public GPS(boolean ON)
	{
		on = ON;
		generarCoordenadas();
	}
	
	public boolean isOn()
	{
		return on;
	}

	public void setOn(boolean on)
	{
		this.on = on;
	}

	public String getValor()
	{
		return valor;
	}

	public void setValor(String Valor)
	{
		valor = Valor;
	}
	
	public void generarCoordenadas()
	{
		double x;
		double y;
		if(Math.random()*2 < 1)
			x = Math.floor(Math.random()*91*10)/10;
		else
			x = (Math.floor(Math.random()*91*10)/10)*(-1);
		if(Math.random()*2 < 1)
			y = Math.floor(Math.random()*91*10)/10;
		else
			y = (Math.floor(Math.random()*91*10)/10)*(-1);
		valor = "" + x + ", " + y;
	}

	public static void main(String[] args)
	{
		GPS a = new GPS();
		a.generarCoordenadas();
	}
}
